  //左中 条形图
$.get('http://127.0.0.1:5000/task2').done(function (data) {
        var myCharts = echarts.init(document.querySelector('.panel .bar2'))
        option = {
            title: {
                text: "数量前十的商品",
                subtext: "购物篮数据",
                x: "center",
                y: "4%",
                textStyle: {
                    color: '#fff',
                    fontSize: '18'
                },
                subtextStyle: {
                    color: '#fff',
                    fontSize: '10',

                },
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            grid: {
                top: '25%',
                right: '3%',
                left: '15%',
                bottom: '10%'
            },
            xAxis: [{
                type: 'value',
                axisLabel: {
                    margin: 10,
                    color: '#e2e9ff',
                    rotate:0,
                    textStyle: {
                        fontSize: 8
                    },
                },
                min: function (value) {
                    return value.min;
                    },
                max: function (value) {
                    return value.max;
                }
            }],
            yAxis: [{
                type: 'category',
                name: '商品数',
                nameTextStyle:{
                         color: '#e2e9ff',
                         fontSize:12,
                     },
                axisLabel: {
                    margin: 10,
                    color: '#e2e9ff',
                    rotate:0,
                    textStyle: {
                        fontSize: 10
                    },
                },
                data: data.name,
            }],
            series: [{
                type: 'bar',
                data: data.value,
                barWidth: '10px',
                itemStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(0,244,255,1)' // 0% 处的颜色
                        }, {
                            offset: 1,
                            color: 'rgba(0,77,167,1)' // 100% 处的颜色
                        }], false),
                        barBorderRadius: [30, 30, 30, 30],
                        shadowColor: 'rgba(0,160,221,1)',
                        shadowBlur: 4,
                    }
                }
            }]
        };
        myCharts.setOption(option)
    })